package com.tutu;

import android.app.Application;
import android.content.Context;

import com.hyphenate.chat.EMOptions;
import com.hyphenate.easeui.EaseUI;
import com.tutu.model.Model;

/**
 * @author 图图 2020/9/29
 * @email xieh_mail@163.com
 *
 */
public class IMApplication extends Application {

    private static Context mContext;
    @Override
    public void onCreate() {
        super.onCreate();
        // 初始化EaseUI
        EMOptions easeuiOptions = new EMOptions();
        easeuiOptions.setAcceptInvitationAlways(false); //设置需要同意后才能接受邀请
        easeuiOptions.setAutoAcceptGroupInvitation(false); //设置需要同意后才能接受群邀请
        EaseUI.getInstance().init(this,easeuiOptions);

        // 初始化数据模型层对象
        Model.getInstance().init(this);
        // 初始化全局上下文对象
        mContext = this;
    }


    /**
     * 获取全局上下文对象
     * @return
     */
    public static Context getGlobalApplication(){
        return mContext;
    }
}
